#! /bin/bash

while getopts t:c:s:uep flag
do
    case "${flag}" in
        u) func=ON;;
        e) perf=ON;;
        p) comp=ON;;
        s) model=${OPTARG};;
        t) token=${OPTARG};;
        c) callback=${OPTARG};;
    esac
done

if [[ "$func" == "ON" ]]; then
  curl -X GET -H 'Content-type: application/json; Accept: application/json; charset=UTF-8' -d '{"model_name":"ResNet50"}' http://127.0.0.1:8100/test-6?token=$token\&callback=$callback
elif [[ "$perf" == "ON" ]]; then
  curl -X GET -H 'Content-type: application/json; Accept: application/json; charset=UTF-8' -d '{"model_name":"ResNet50"}' http://127.0.0.1:8100/test-11?token=$token\&callback=$callback
elif [[ "$comp" == "ON" ]]; then
  curl -X GET -H 'Content-type: application/json; Accept: application/json; charset=UTF-8' -d "{\"model_name\":\"$model\"}" http://127.0.0.1:8100/test-13?token=$token\&callback=$callback
fi